bitkeeper revision 1.1159.1.211 (4163fb35XBjUO8_fLeyomd3I9mHZOA)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Wed, 6 Oct 2004 14:03:33 +0000 (14:03 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Wed, 6 Oct 2004 14:03:33 +0000 (14:03 +0000)
Get rid of delay between finishing the transfer of a domain and when it gets to run.

tools/libxc/xc_linux_restore.c
tools/xfrd/xen_domain.c
tools/xfrd/xfrd.c

index 3973c8522589ff6b47456ca6dc0214726a7e8db3..93b78c4c87edaeb15d4fe007144f1c70c50679d2 100644 (file)
@@ -689,8 +689,19 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt)
     op.u.builddomain.ctxt = &ctxt;
     rc = do_dom0_op(xc_handle, &op);
 
-    /* don't start the domain as we have console etc to set up */
-  
+    if ( rc != 0 )
+    {
+        xcio_error(ioctxt, "Couldn't build the domain");
+        goto out;
+    }
+
+    if ( ioctxt->flags & XCFLAGS_CONFIGURE )
+    {
+        op.cmd = DOM0_UNPAUSEDOMAIN;
+        op.u.unpausedomain.domain = (domid_t)dom;
+        rc = do_dom0_op(xc_handle, &op);
+    }
+
     if ( rc == 0 )
     {
         /* Success: print the domain id. */
index feb0d9d02b72ba7be6f4d4c0db57ae3067c6c425..6f254053822ee0e381ed2ad5b2e5fac1b5961baa 100644 (file)
@@ -138,9 +138,8 @@ int xen_domain_rcv(IOStream *io,
     ioctxt->info = iostdout;
     ioctxt->err = iostderr;
     ioctxt->configure = domain_configure;
-    if(!configured){
+    if ( !*configured )
         ioctxt->flags |= XCFLAGS_CONFIGURE;
-    }
 
     err = xc_linux_restore(xcinit(), ioctxt);
     *dom = ioctxt->domain;
index 2a73d7a64ba5fcc5a0bbdc417a54c21ad68ded7a..5da736f6a95d649e6f95ff9ff7057a4cee2583eb 100644 (file)
@@ -863,9 +863,9 @@ int xfr_recv(Args *args, XfrState *state, Conn *peer){
         dprintf("> Configuring...\n");
         err = xen_domain_configure(state->vmid_new, state->vmconfig, state->vmconfig_n);
         if(err) goto exit;
+        err = xen_domain_unpause(state->vmid_new);
+        if(err) goto exit;
     }
-    err = xen_domain_unpause(state->vmid_new);
-    if(err) goto exit;
     // Report new domain id to peer.
     err = xfr_send_xfr_ok(peer, state->vmid_new);
     if(err) goto exit;